<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>增加用户</title>
<link rel="stylesheet" href="../css/admin.css">
<script type="text/javascript" src="../js/cal/jquery-1.7.js">
	
</script>
<script>
	function checkForm() {
		if ($("#username").val() == "") {
			$("#tips_username").html("用户名不能为空！");
			$("#username").focus();
			return false;
		} else {
			$("#tips_username").html("OK！");

		}

		if ($("#password").val() == "") {
			$("#tips_password").html("密码不能为空！");
			$("#password").focus();
			return false;
		} else {
			$("#tips_password").html("OK！");

		}

		if ($("#password").val().length < 6 || $("#password").val().length > 18) {
			$("#tips_password").html("密码长度须在6-18之间！");
			$("#password").focus();
			return false;
		} else {
			$("#tips_password").html("OK！");

		}
		if ($("#password").val() != $("#repassword").val()) {
			$("#tips_repassword").html("两次输入的密码不一致！");
			$("#repassword").focus();
			return false;

		} else {

			$("#tips_repassword").html("OK！");
		}
		if ($("#realname").val() == "") {
			$("#tips_realname").html("真实姓名不能为空！");
			$("#realname").focus();
			return false;
		} else {
			$("#tips_realname").html("OK！");

		}

	}
</script>
</head>

<body>
	<form action="UserServlet?action=add" method="post" id="myform">
		<fieldset>
			用户基本信息
			<div>
				<label for="username" class="left">用户名：</label> <input type="text"
					name="username" id="username" onBlur="checkForm()" /> <span
					id="tips_username">*</span>
			</div>
			<div>
				<label for="password" class="left">密码：</label> <input
					type="password" name="password" id="password" onBlur="checkForm()" />
				<span id="tips_password">*</span>
			</div>
			<div>
				<label for="repassword" class="left">确认密码：</label> <input
					type="password" name="repassword" id="repassword"
					onBlur="checkForm()" /> <span id="tips_repassword">*</span>
			</div>
			<div>
				<label for="realname" class="left">真实姓名：</label> <input type="text"
					name="realname" id="realname" /> <span id="tips_realname">*</span>
			</div>
			<div>
				<label for="usertype" class="left">用户类别：</label> 
				<select name="usertype">
					<option value="管理员">管理员</option>
					<option value="学生">学生</option>
					<option value="普通用户">普通用户</option>
				</select> 
				<span id="tips_usertype">*</span>
			</div>
			<div class="submit">
				<input type="submit" value="提交" class="button" /> <input
					type="reset" value="重置" class="button" />
			</div>
		</fieldset>
	</form>
</body>
</html>
